package com.sec.history.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sec.base.utils.AjaxJson;
import com.sec.history.service.HistoryService;

@RestController
@RequestMapping(value = "/history")
@CrossOrigin
public class HistoryController {

	@Autowired
	private HistoryService historyService;

	/**
	 * 获取分页数据
	 * 
	 * @param pageNumber
	 * @param pageSize
	 * @return
	 */
	@RequestMapping(value = "findHistoryListByPage", method = RequestMethod.POST)
	public AjaxJson findHistoryListByPage(HttpServletRequest request, int pageNumber, int pageSize) {
		return historyService.findHistoryListByPage(request, pageNumber, pageSize);
	}

	/**
	 * 获取历时数据信息
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "getHistroyInfo", method = RequestMethod.POST)
	public AjaxJson getHistroyInfo(String id) {
		return historyService.getHistroyInfo(id);
	}
}
